<div class="layui-card" style="width: 400px;margin: 100px auto;">
  <div class="layui-card-header">修改密码</div>
  <div class="layui-card-body">
		<form class="layui-form" action="changePassword" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">旧密码</label>
			    <div class="layui-input-block">
			    	<input type="password" name="oldPwd" required  lay-verify="required" placeholder="请输入旧密码"  autocomplete="off" class="layui-input">
			    </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">新密码</label>
			    <div class="layui-input-block">
			    	<input id="newPwd" type="password" name="newPwd" required  lay-verify="required|confirmPwd" placeholder="请输入新密码"  autocomplete="off" class="layui-input">
			    </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">密码确认</label>
			    <div class="layui-input-block">
			    	<input id="newPwd2" type="password" name="newPwd2" required  lay-verify="required" placeholder="密码确认"  autocomplete="off" class="layui-input">
			    </div>
			</div>
			<hr>
			<div class="layui-form-item" style="text-align: right;">
				<button class="layui-btn  layui-btn-normal" lay-submit type="submit" lay-filter="cp">提交</button>
				<button class="layui-btn" type="reset">重置</button>
			</div>
		</form>
  </div>
</div>
<script type="text/javascript">
		var $=layui.$;
		var form=layui.form;
		form.verify({
			confirmPwd : function(value){
				var newPwd=$('#newPwd2').val();
				if(value!==newPwd){
					$('#newPwd').val('');
					$('#newPwd2').val('');
					return "两次输入新密码不一致！";
				}
			}
		});
</script>
